--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 3d53ca0124ec969b61a5b89bc5babfb2a394da8b
Parents : b579602
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-05-12T14:03:35+02:00
Outbound procedure fix
Changes
Diff
diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py
index 11b3422..b717252 100644
--- a/LXMF/LXMF.py
+++ b/LXMF/LXMF.py
@@ -71,6 +71,12 @@ class LXMessage:
PLAIN_PACKET_MDU = RNS.Packet.PLAIN_MDU
PLAIN_PACKET_MAX_CONTENT = PLAIN_PACKET_MDU - LXMF_OVERHEAD + DESTINATION_LENGTH
+ def __str__(self):
+ if self.hash != None:
+ return "<LXMessage "+RNS.hexrep(self.hash, delimit=False)+">"
+ else:
+ return "<LXMessage>"
+
def __init__(self, destination, source, content = "", title = "", fields = None, desired_method = None, destination_hash = None, source_hash = None):
if isinstance(destination, RNS.Destination) or destination == None:
self.__destination = destination
@@ -406,13 +412,14 @@ class LXMRouter:
self.__delivery_callback = callback
def handle_outbound(self, lxmessage):
+ if not lxmessage.packed:
+ lxmessage.pack()
+
RNS.log("LXM Router received outbound message: "+str(lxmessage))
+
while self.processing_outbound:
time.sleep(0.1)
- if not lxmessage.packed:
- lxmessage.pack()
-
self.pending_outbound.append(lxmessage)
self.process_outbound()
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────